package com.victualler.business.customer.controller;

import com.victualler.business.customer.dto.PreCustomerInfoDto;
import com.victualler.business.customer.dto.dataview.MounthQuantityDto;
import com.victualler.business.customer.dto.request.PreCustomerRequestDto;
import com.victualler.business.customer.dto.request.weixin.WxOrderRequestDto;
import com.victualler.business.customer.entity.PreCustomerOrderDao;
import com.victualler.business.customer.repository.PreCustomerOrderQueryRepository;
import com.victualler.business.customer.repository.PreCustomerOrderRepository;
import com.victualler.business.customer.service.PreCustomerOrderService;
import com.victualler.core.base.controller.BaseRestController;
import com.victualler.core.common.dto.PageDto;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletResponse;
import java.util.List;


/**
 * @author: Guoshichang
 * @discription:
 */
public interface PreCustomerOrderController  extends BaseRestController<PreCustomerOrderDao,PreCustomerOrderRepository,PreCustomerOrderQueryRepository,PreCustomerOrderService> {


    /**
     * @author Guoshichang
     * @since 13:39 on 2018/7/7.
     * @param preCustomerRequestDto 请求对象
     * @Function  根据条件入参prePurchaseRequestDto动态分页查询权限
     */
    @RequestMapping("/getByRequestDto")
    public PageDto<PreCustomerOrderDao> getByRequestDto(@RequestBody PreCustomerRequestDto preCustomerRequestDto, @RequestParam("pageNo") int pageNo, @RequestParam("limit") int limit);

    /**
     * @author Guoshichang
     * @since 13:39 on 2018/7/7.
     * @param id 预订单id
     * @Function  根据条件入参prePurchaseRequestDto动态分页查询权限
     */
    @RequestMapping("/findInfo/{id}")
    public PreCustomerInfoDto findInfo(@PathVariable("id") Long id);

    /**
     * @author Guoshichang
     * @since 13:39 on 2018/7/7.
     * @param preCustomerInfoDto 预订单实体大对象
     * @Function  保存预订单实体大对象
     */
    @RequestMapping("/saveInfo")
    public void saveInfo(@RequestBody PreCustomerInfoDto preCustomerInfoDto);

    /**
     * @author Guoshichang
     * @since 18:01 on 2018/10/9.
     * @param preCustomerOrderDao 审查大对象
     * @return
     * @Function
     */
    @RequestMapping("/check")
    public void check(@RequestBody PreCustomerOrderDao preCustomerOrderDao);

    /**
     * @author Guoshichang
     * @since 13:39 on 2018/7/7.
     * @param id 预订单id
     * @Function  根据条件入参prePurchaseRequestDto动态分页查询权限
     */
    @RequestMapping("/deleteInfo/{id}")
    public void deleteInfo(@PathVariable("id") Long id);


    /**
     * @author Guoshichang
     * @since 19:54 on 2018/7/23.
     * @param response 存放文件的 输出流
     * @param orderNo 订单号
     * @Function 将文件从影像系统下载下来并且打印返回到response的流中
     */
    @RequestMapping("/exportFile/{type}/{orderNo}")
    public void exportFile(@PathVariable("type")String type,@PathVariable("orderNo") String orderNo, HttpServletResponse response);


        /**
         * @author Guoshichang
         * @since 12:00 on 2019/1/18.
         * @param wxOrderRequestDto 微信购物车下单大对象
         * @return 无
         * @Function  将微信报货单报货对象
         */
    @RequestMapping("/sendWeiXinOrder")
    public void sendWeiXinOrder(@RequestBody WxOrderRequestDto wxOrderRequestDto);

    @RequestMapping("/getSumQuantityDataView")
    public List<MounthQuantityDto> getSumQuantityDataView();

    @RequestMapping("/getQuantityByGoods")
    public List<MounthQuantityDto> getQuantityByGoods();

    /**
     * @author Guoshichang
     * @since 11:52 on 2019/1/31.
     * @param null
     * @return
     * @Function 获得前三十天内销量top10的商家
     */
    @RequestMapping("/getQuantityByCustomer")
    public List<MounthQuantityDto> getQuantityByCustomer();
}
